import * as actionTypes from "./constance";
import { getProgramDetail, getCommentDj } from "@/services/program";

const programDetail = (res) => ({
  type: actionTypes.GET_PROGRAM_DETAIL,
  programDetailInfo: res,
});

const CommentDj = (res) => ({
  type: actionTypes.GET_COMMENT_DJ,
  commentInfo: res,
});

export const programDetailAction = (id) => {
  return (dispatch) => {
    getProgramDetail(id).then((res) => {
      dispatch(programDetail(res));
    });
  };
};
export const commentDjAction = (id, limit, offset, before) => {
  return (dispatch) => {
    getCommentDj(id, limit, offset, before).then((res) => {
      dispatch(CommentDj(res));
    });
  };
};
